package cn.ouryears.common.exception.handle;

/**
 *  Interface to be implemented by objects that will handle exception.
 */

public interface ExceptionHandler {

	/** 
	 * Handle exception.
	 * 
	 * @param t	the throwable object.
	 * @param obj The pass in object may be processed and return out.
	 * @return	object which passed in. But it can be other object as well.
	 */
	public Object handleException(Throwable t, Object obj);

	/**
	 * Check if the exception should be handled.
	 * @param t	the throwable object.
	 * @return	true if the throwable can be handled, otherwise false.
	 */
	public boolean canHandle(Throwable t);
	
}
